<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>

	<body>
		<div id="app">
			<!-- 3.使用组件 -->
			<my-cpn></my-cpn>
			<my-cpn></my-cpn>
			<my-cpn></my-cpn>
		</div>

		<script src="../lib/vue.js"></script>
		<script>
			// 1.创建组件构造器对象
			const myCpn = Vue.extend({
				template: `<div>
          <h2>我是标题</h2>
          <p>我是内容，哈哈哈</p>
          <p>我是内容，可可可</p>
          </div>`
			});
			// 2.注册组件
			Vue.component("my-cpn", myCpn);

			let vm = new Vue({
				el: "#app",
				data: { message: "hello" },
				methods: {}
			});
		</script>
	</body>
</html>
